<template>
	<view>
		<view class="mainpadding_top flexbetween ffffff" v-for="item in list.data" :key="item.id" @click="checkShop(item.id)">
			<view class="flexleft">
				<image :src="item.logoimage" class="listleftimg2" mode=""></image>
				<view class="hei_text main_size bold margin_left2">{{item.name}}</view>
			</view>
			<view class="listbtnhuang">選擇</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:{
					data:[]
				}
			}
		},
		onLoad() {
			this.getShopList()
		},
		methods: {
			async getShopList() {
				let _this = this
				let res = await this.http.request('/api/shop/Shoplist', 'GET', {})
				if (res.code == 1) {
					res.data.forEach(item=>{
						item.logoimage=this.imgUrl+item.logoimage
					})
					this.list.data = res.data
					console.log(this.list.data[1].logoimage);
				} else if (res.code == 0) {
					// this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			checkShop(id) {
				uni.$emit("selectShop",id)
				uni.navigateBack(1)
			},
		}
	}
</script>

<style scoped>
	.listleftimg2 {
		width: 80rpx;
		height: 80rpx;
	}
</style>